#ifndef UART_H
#define	UART_H

#include <stdarg.h>
#define SUPPORT_LOG 1
#define DATE "20211026"
#define VERSION 0x05

typedef struct
{
	uint8_t data[30];
	uint8_t index;
}Msg_t;

typedef struct _ST_CirQueue
{
    uint8_t            *m_pu8Data;
    uint16_t           m_u16Size;
    uint16_t           m_u16Front;
    uint16_t           m_u16Rear;
    uint16_t           m_u16Count;
} ST_CirQueue;


extern Msg_t uart1_data;
extern uint8_t uart1_data_index;
extern volatile U8_T uart1_count;
extern int uart1_rx_flag; 
extern int count_1ms;

/*
*/

//void apt_printf(char *fmt,...);
void hex_debug(uint8_t *data, uint16_t size);
void my_printf(char *fmt,...);


#if SUPPORT_LOG
#define debug_msg (apt_printf("[%s] [%d]:", __func__, __LINE__), apt_printf)
#define apt_printf my_printf
#else
#define debug_msg(format,...)
#define apt_printf(fmt,...)
#endif

int judge_data(ST_CirQueue* data, int size);
int uart0_rx_handle();
int uart1_rx_handle();

#endif
